﻿@model MusicStore.Models.Album
@{
    ViewBag.Title = "Create";
}

@*@using(Html.BeginForm("方法名"),"控制器名",数据访问方式Get/Post)*@

<h2>新建专辑页面</h2>
@using (Html.BeginForm())
{
    //防止CSRF攻击：防跨站请求攻击
    @Html.AntiForgeryToken()
    <div>
        <h4>当前唱片</h4>
        @*简单验证：当其值为真时，进行数据验证操作*@
        @Html.ValidationSummary(true,"")
        <div>
            @Html.LabelFor(model => model.ArtistId, "歌手")
            <div>
                @Html.DropDownList("ArtistId")
                @Html.ValidationMessageFor(model => model.ArtistId, "")
            </div>

        </div>

        <div>
            @Html.LabelFor(model => model.Title, "专辑名")
            <div>
                @Html.EditorFor(model => model.Title)
                @Html.ValidationMessageFor(model => model.Title, "")
            </div>
        </div>

        <div>
            @Html.LabelFor(model => model.Price, "价格")
            <div>
                @Html.EditorFor(model => model.Price)
                @Html.ValidationMessageFor(model => model.Price)
            </div>
        </div>

        <div>
            @Html.LabelFor(model => model.AlbumArtUrl, "链接")
            <div>
                @Html.EditorFor(model => model.Price)
                @Html.ValidationMessageFor(model => model.AlbumArtUrl)
            </div>
        </div>
        <input type="submit" value="添加" />
    </div>
}
@*<p>
@Html.LabelFor(model=>model.ArtistId,"歌手")
@Html.DropDownList("ArtistId")
</p>

<p>
    @Html.LabelFor(model => model.Title, "专辑名")
    @Html.TextBox("Title")
</p>
<p>
    @Html.LabelFor(model => model.Price, "价格")
    @Html.TextBox("Price")
</p>
<p>
    @Html.LabelFor(model => model.AlbumArtUrl, "链接")
    @Html.TextBox("AlbumArtUrl")
</p>*@
